Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hoek

Package Overview
Dependencies
Maintainers
5
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoek

General purpose node utilities

  • 4.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8M
increased by21.17%
Maintainers
5
Weekly downloads
 
Created

What is hoek?

The hoek package is a utility library that offers a variety of functions for object manipulation, array manipulation, type checking, and encoding. It is designed to provide developers with tools to simplify common tasks in JavaScript programming.

What are hoek's main functionalities?

Object cloning

This feature allows for deep cloning of objects, ensuring that nested objects are cloned properly rather than just copying references.

const hoek = require('hoek');
const obj = { a: 1 };
const clone = hoek.clone(obj);

Merge objects

Merge two objects into one, where the second object's properties are added to the first object. This is useful for combining configurations or settings.

const hoek = require('hoek');
const target = { a: 1 };
const source = { b: 2 };
hoek.merge(target, source);

Assert

Provides a simple assertion utility to validate conditions. If the condition is false, it throws an error with the provided message.

const hoek = require('hoek');
hoek.assert(1 === 1, 'This will not throw');
hoek.assert(1 === 2, 'This will throw an error');

Reach

Allows for safely reaching into an object for a nested property. This helps in avoiding errors when accessing deeply nested properties.

const hoek = require('hoek');
const obj = { a: { b: { c: 1 } } };
const value = hoek.reach(obj, 'a.b.c');

Other packages similar to hoek

Keywords

FAQs

Package last updated on 26 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc